package com.seal.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.seal.comm.utils.Page;
import com.seal.dao.IAreaDao;
import com.seal.dto.AreaDto;
import com.seal.model.TArea;
import com.seal.service.IAreaService;

@Service("areaServiceImpl")
@Transactional(readOnly = true)
public class AreaServiceImpl implements IAreaService{
	@Resource(name= "areaDaoImpl")
	private IAreaDao areaDao;

	@Transactional(propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName="Exception")
	public void addTArea(TArea ca) throws Exception {
		areaDao.addTArea(ca);
	}

	@Transactional(propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName="Exception")
	public void deleteTArea(TArea ca) throws Exception {
		areaDao.deleteTArea(ca);
	}

	public List<TArea> getAllTArea(AreaDto areaDto, Page page) throws Exception {
		return areaDao.getAllTArea(areaDto, page);
	}

	public TArea getTAreaById(Long id) throws Exception {
		return areaDao.getTAreaById(id);
	}

	@Transactional(propagation = Propagation.REQUIRED,readOnly = false,rollbackForClassName="Exception")
	public void updateTArea(TArea ca) throws Exception {
		areaDao.updateTArea(ca);
	}	
	
}
